package com.lq.mapper;

import com.lq.pojo.Article;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface ArticleMapper {

    //通过登录用户id获取总共的发布文章数量
    Integer getNumOfPublishArticle(Integer userId);

    boolean publishArticle(Article article, Integer userId);

    List<Article> getAllArticle();

    boolean deleteArticleById(Integer articleId);

    Article getArticleById(Integer articleId);

    //获取最新的五篇文章
    List<Article> getLatestArticle(Integer limit);

    //由文章id获取分类
    String getArticleCategoryByArticleId(Integer articleId);

    boolean deleteAllArticleComment(Integer articleId);

    void updateArticleByArticleId(Article article, Integer articleId);
}
